$("#form_hotel_room_type input[type=text], #form_hotel_room_type select").removeClass("field-with-errors")
$("#form_hotel_room_type .error-message").html("").removeClass("alert alert-error")

<% if @hotel_room_type.errors.any? %>
  <% flash[:alert] = 'Something Error!' %>
  $("#flash_message_wrapper").html("<%=j render partial: 'layouts/flash_messages' %>"); 
  <% @hotel_room_type.errors.each do | field, message| %>
    $("#hotel_room_type_<%=j field.to_s %>").addClass("field-with-errors")
    $("#<%=j field.to_s %>_error").html("<%=j message %>").addClass('red')
  <% end %>
<% else %>
  $('#admin_content').html("<%=j render partial: 'hotel_room_types/index', locals: { :hotel_room_types => @hotel_room_types } %>")
  <% flash[:notice] = ' Hotel Room Type successfully Updated' %>
  $("#flash_message_wrapper").html("<%=j render partial: 'layouts/flash_messages' %>");
<% end %>